import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login/login'
import Register from '@/components/register/register'
import Home from '@/components/home/home'
import Student from '@/components/student/student'
import User from '@/components/user/user'
import CourseDegree from '@/components/achievement/courseDegree/CourseDegree'
import GraduationDegree from '@/components/achievement/graduationDegree/graduationDegree'
import Assessment from '@/components/assessment/assessment'
import Course from '@/components/course/course'
import Graduation from '@/components/graduation/graduation'
import Result from '@/components/result/result'
import Schedule from '@/components/schedule/schedule'
import Role from '@/components/role/role'
import Class from '@/components/class/class'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      children: [
        {
          path: '/student',
          name: 'student',
          component: Student,
          meta: {keepAlive: true}
        },
        {
          path: '/user',
          name: 'user',
          component: User,
          meta: {keepAlive: true}
        },
        {
          path: '/courseDegree',
          name: 'courseDegree',
          component: CourseDegree,
          meta: {keepAlive: false}
        },
        {
          path: '/graduationDegree',
          name: 'graduationDegree',
          component: GraduationDegree,
          meta: {keepAlive: false}
        },
        {
          path: '/assessment',
          name: 'assessment',
          component: Assessment,
          meta: {keepAlive: false}
        },
        {
          path: '/course',
          name: 'course',
          component: Course,
          meta: {keepAlive: false}
        },
        {
          path: '/graduation',
          name: 'graduation',
          component: Graduation,
          meta: {keepAlive: true}
        },
        {
          path: '/result',
          name: 'result',
          component: Result,
          meta: {keepAlive: false}
        },
        {
          path: '/schedule',
          name: 'schedule',
          component: Schedule,
          meta: {keepAlive: false}
        },
        {
          path: '/role',
          name: 'role',
          component: Role,
          meta: {keepAlive: true}
        },
        {
          path: '/class',
          name: 'class',
          component: Class,
          meta: {keepAlive: true}
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    }
  ]
})
